package com.lcf.app.client2;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.time.LocalDateTime;
import java.util.concurrent.TimeUnit;

/**
 * @author ChenFei
 * @date 2021/11/25
 */
@SpringBootApplication
@EnableScheduling
public class Client2Application {

    public static void main(String[] args) {
        SpringApplication.run(Client2Application.class, args);
    }

    private static final Logger logger = LoggerFactory.getLogger(Client2Application.class);

    @Scheduled(timeUnit = TimeUnit.SECONDS, fixedRate = 1)
    public void logTest() {
        logger.info("log test : {}", LocalDateTime.now());
    }
}
